package com.cloud.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class CloudResult implements Serializable {

    private static final long serialVersionUID = 4254625047054903756L;
    private Integer flag;   //200成功，0失败
    private String msg;       //提示信息
    private Object data;      //服务器返回值数据

    public static CloudResult fail(){
        return new CloudResult(0,"业务调用失败",null);
    }
    public static CloudResult success(Object data){
        return new CloudResult(200,"业务调用成功",data);
    }
    public static CloudResult success(String msg,Object data){
        return new CloudResult(200,msg,data);
    }    public static CloudResult success(){
        return new CloudResult(200,"业务调用成功",null);
    }
}
